<?php
include_once("db_connect.php");

$postdata = file_get_contents("php://input");
if (isset($postdata) && !empty($postdata)) {
    $request = json_decode($postdata);
    $user_id = trim($request->user_id);

    $sql = "DELETE FROM login_user WHERE user_id = '$user_id'";

    $result = $mysqli->query($sql);

    if ($result) {
        $data = array('message' => 'Delete User Successful');
        echo json_encode($data);
    } else {
        $data = array('message' => 'Delete User Failed');
        echo json_encode($data);
    }
}
